<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>if和else语句</title>
	</head>
	<body>
		<script type="text/javascript">
			/*
			var distance = 10;
			var nowDistance = 16;
			if ( nowDistance <= distance) {
				console.log('自动驾驶');
			}else{
				console.log('人为驾驶');
			}
			*/
		   var weather = 'rainyxxxxxx';
		   if (weather === 'sunny'){
			   console.log('
					天气非常棒,可以出去玩耍');
		   }else if(weather==='rainy'){
			   console.log('
					天气下雨了,在家里呆着');
		   }else if(weather=== 'snowing'){
			   console.log('
			   天气下雪了,可以出去滑雪');
		   }else{
			   alert('输入的天气有错,请重新输入.');
		   }
			
		</script>
	</body>
</html>
